
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>docker12 commit镜像 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="docker13 容器数据卷.html" />
    
    
    <link rel="prev" href="docker11 镜像原理.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="docker01 docker能干嘛.html">
            
                <a href="docker01 docker能干嘛.html">
            
                    
                    docker01 docker能干嘛
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="docker02 安装docker.html">
            
                <a href="docker02 安装docker.html">
            
                    
                    docker02 安装docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="docker03 docker原理.html">
            
                <a href="docker03 docker原理.html">
            
                    
                    docker03 docker原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="docker04 镜像基本命令.html">
            
                <a href="docker04 镜像基本命令.html">
            
                    
                    docker04 镜像基本命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="docker05 容器基本命令.html">
            
                <a href="docker05 容器基本命令.html">
            
                    
                    docker05 容器基本命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="docker06 常用其他命令.html">
            
                <a href="docker06 常用其他命令.html">
            
                    
                    docker06 常用其他命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="docker07 进入当前正在运行的容器.html">
            
                <a href="docker07 进入当前正在运行的容器.html">
            
                    
                    docker07 进入当前正在运行的容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="docker08 部署nginx.html">
            
                <a href="docker08 部署nginx.html">
            
                    
                    docker08 部署nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="docker09 部署tomcat.html">
            
                <a href="docker09 部署tomcat.html">
            
                    
                    docker09 部署tomcat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="docker10 可视化面板.html">
            
                <a href="docker10 可视化面板.html">
            
                    
                    docker10 可视化面板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="docker11 镜像原理.html">
            
                <a href="docker11 镜像原理.html">
            
                    
                    docker11 镜像原理
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13" data-path="docker12 commit镜像.html">
            
                <a href="docker12 commit镜像.html">
            
                    
                    docker12 commit镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="docker13 容器数据卷.html">
            
                <a href="docker13 容器数据卷.html">
            
                    
                    docker13 容器数据卷
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="docker14 具名挂载和匿名挂载.html">
            
                <a href="docker14 具名挂载和匿名挂载.html">
            
                    
                    docker14 具名挂载和匿名挂载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="docker15 初始dockerfile.html">
            
                <a href="docker15 初始dockerfile.html">
            
                    
                    docker15 初始dockerfile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="docker16 数据卷容器.html">
            
                <a href="docker16 数据卷容器.html">
            
                    
                    docker16 数据卷容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="docker17 dockerFile.html">
            
                <a href="docker17 dockerFile.html">
            
                    
                    docker17 dockerFile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="docker18 dockerFile基本命令.html">
            
                <a href="docker18 dockerFile基本命令.html">
            
                    
                    docker18 dockerFile基本命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="docker19 构建自己的centos.html">
            
                <a href="docker19 构建自己的centos.html">
            
                    
                    docker19 构建自己的centos
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="docker20 发布镜像.html">
            
                <a href="docker20 发布镜像.html">
            
                    
                    docker20 发布镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22" data-path="docker21 网络详情.html">
            
                <a href="docker21 网络详情.html">
            
                    
                    docker21 网络详情
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.23" data-path="docker22 容器互联.html">
            
                <a href="docker22 容器互联.html">
            
                    
                    docker22 容器互联
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.24" data-path="docker23 自定义网络.html">
            
                <a href="docker23 自定义网络.html">
            
                    
                    docker23 自定义网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.25" data-path="docker24 SpringBoot 微服务打包Docker镜像.html">
            
                <a href="docker24 SpringBoot 微服务打包Docker镜像.html">
            
                    
                    docker24 SpringBoot 微服务打包Docker镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.26" data-path="docker25 dockerFile_demo.html">
            
                <a href="docker25 dockerFile_demo.html">
            
                    
                    docker25 dockerFile_demo
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >docker12 commit镜像</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="commit&#x955C;&#x50CF;">commit&#x955C;&#x50CF;</h3>
<pre><code class="lang-bash">docker commit &#x63D0;&#x4EA4;&#x4E00;&#x4E2A;&#x5BB9;&#x5668;&#x6210;&#x4E3A;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x526F;&#x672C;
<span class="hljs-comment"># &#x547D;&#x4EE4;&#x4E0E;git&#x539F;&#x7406;&#x76F8;&#x4F3C;</span>
docker commit -m= <span class="hljs-string">&quot;&#x63D0;&#x4EA4;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;&quot;</span> <span class="hljs-_">-a</span>= <span class="hljs-string">&quot;&#x4F5C;&#x8005;&quot;</span> &#x5BB9;&#x5668;id  &#x76EE;&#x6807;&#x955C;&#x50CF;&#x540D;:[TAG]
</code></pre>
<pre><code class="lang-bash"><span class="hljs-comment"># 1. &#x542F;&#x52A8;&#x4E00;&#x4E2A;&#x9ED8;&#x8BA4;&#x7684;tomcat</span>
<span class="hljs-comment"># 2. &#x53D1;&#x73B0;&#x8FD9;&#x4E2A;&#x9ED8;&#x8BA4;&#x7684;tomcat&#x662F;&#x6CA1;&#x6709;webapps&#x5E94;&#x7528;,&#x955C;&#x50CF;&#x7684;&#x539F;&#x56E0;,&#x5B98;&#x65B9;&#x7684;&#x955C;&#x50CF;&#x9ED8;&#x8BA4;webapps&#x4E0B;&#x9762;&#x662F;&#x6CA1;&#x6709;&#x6587;&#x4EF6;&#x7684;!</span>
<span class="hljs-comment"># 3. &#x6211;&#x81EA;&#x5DF1;&#x62F7;&#x8D1D;&#x8FDB;&#x53BB;&#x57FA;&#x672C;&#x7684;&#x6587;&#x4EF6;</span>
<span class="hljs-comment"># 4. &#x5C06;&#x6211;&#x4EEC;&#x64CD;&#x4F5C;&#x8FC7;&#x7684;&#x5BB9;&#x5668;&#x901A;&#x8FC7;commit&#x63D0;&#x4EA4;&#x4E3A;&#x4E00;&#x4E2A;&#x955C;&#x50CF;!&#x6211;&#x4EEC;&#x4EE5;&#x540E;&#x5C31;&#x4F7F;&#x7528;&#x6211;&#x4EEC;&#x4FEE;&#x6539;&#x8FC7;&#x7684;&#x955C;&#x50CF;&#x5373;&#x53EF;,&#x8FD9;&#x5C31;&#x662F;&#x6211;&#x4EEC;&#x81EA;&#x5DF1;&#x7684;&#x4E00;&#x4E2A;&#x4FEE;&#x6539;&#x7684;&#x955C;&#x50CF;</span>

[root@izijy66dzll7bdz app]<span class="hljs-comment"># docker commit -a=&quot;victor&quot; -m&quot;add webapps app&quot; 2e45e79106cf tomcatcommit:1.0</span>
sha256:f511ab5c2884e2481585fec604720eb61dbef94359330b5<span class="hljs-built_in">fc</span>462acf6c053566f
[root@izijy66dzll7bdz app]<span class="hljs-comment"># docker images</span>
REPOSITORY            TAG       IMAGE ID       CREATED         SIZE
tomcatcommit          1.0       f511ab5c2884   6 seconds ago   649MB
[root@izijy66dzll7bdz app]<span class="hljs-comment">#</span>
</code></pre>
<p><strong>&#x5B66;&#x4E60;&#x65B9;&#x5F0F;&#x8BF4;&#x660E;:&#x7406;&#x89E3;&#x6982;&#x5FF5;,&#x4F46;&#x662F;&#x4E00;&#x5B9A;&#x8981;&#x5B9E;&#x8DF5;,&#x6700;&#x540E;&#x5B9E;&#x8DF5;&#x4E0E;&#x7406;&#x8BBA;&#x60F3;&#x7ED3;&#x5408;&#x4E00;&#x6B21;&#x641E;&#x5B9A;&#x8FD9;&#x4E2A;&#x77E5;&#x8BC6;</strong></p>
<ul>
<li>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x8981;&#x4FDD;&#x5B58;&#x5F53;&#x524D;&#x5BB9;&#x5668;&#x7684;&#x72B6;&#x6001;,&#x5C31;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;commit &#x63D0;&#x4EA4;,&#x83B7;&#x5F97;&#x4E00;&#x4E2A;&#x955C;&#x50CF;</li>
<li>&#x5C31;&#x597D;&#x6BD4;&#x6211;&#x4EEC;&#x4EE5;&#x524D;&#x5B66;&#x4E60;vm&#x65F6;&#x5019;,&#x5FEB;&#x7167;</li>
</ul>
<h3 id="&#x53EF;&#x7B97;&#x662F;&#x5165;&#x95E8;&#x4E86;">&#x53EF;&#x7B97;&#x662F;&#x5165;&#x95E8;&#x4E86;</h3>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="docker11 镜像原理.html" class="navigation navigation-prev " aria-label="Previous page: docker11 镜像原理">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="docker13 容器数据卷.html" class="navigation navigation-next " aria-label="Next page: docker13 容器数据卷">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"docker12 commit镜像","level":"1.13","depth":1,"next":{"title":"docker13 容器数据卷","level":"1.14","depth":1,"path":"docker13 容器数据卷.md","ref":"docker13 容器数据卷.md","articles":[]},"previous":{"title":"docker11 镜像原理","level":"1.12","depth":1,"path":"docker11 镜像原理.md","ref":"docker11 镜像原理.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"docker12 commit镜像.md","mtime":"2021-04-17T06:21:12.845Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-17T07:50:48.567Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

